package com.daydayup.mine;

import java.util.Scanner;

/**
 * 测试
 * 
 * @author Administrator
 *
 */
public class Test {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.println("扫雷游戏开始。。。。。");
		System.out.println("请输入行数：");
		int rows = scanner.nextInt();
		System.out.println("请输入列数：");
		int columns = scanner.nextInt();
		System.out.println("请输入雷的数量：");
		int count = scanner.nextInt();
		System.out.println("请输入第一个的横坐标：");
		int firstRow = scanner.nextInt();
		System.out.println("请输入第一个的纵坐标：");
		int firstColumn = scanner.nextInt();
		MineSweeper mineSweeper = new MineSweeper();
		mineSweeper.init(rows, columns);
		mineSweeper.createMines(rows, columns, firstRow, firstColumn, count);
		int notMineCount = 1;
		do {
			mineSweeper.calculateMineCount(firstRow, firstColumn, rows, columns);
			notMineCount += 1;
			System.out.println("请输入下一个的横坐标：");
			firstRow = scanner.nextInt();
			System.out.println("请输入下一个的纵坐标：");
			firstColumn = scanner.nextInt();
		} while (notMineCount != (rows * columns - count));
		System.out.println("==============恭喜扫雷游戏成功===============");
		scanner.close();
	}

}
